import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-07-21
 * Time: 10:03
 */
public class FindBooks implements Port{
    @Override
    public void work(BookList bookList) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你要查找的书名");
        String bookName=scanner.nextLine();
        for(int i=0;i< bookList.getUserSize();i++){
            Book book=bookList.getBooks(i);
            if(bookName.equals(book.getName())){
                System.out.println("找到了");
                System.out.println(book);
                return;
            }
        }
        System.out.println("没找到");
    }
}
